package com.ecommerce.dal.entity;
// Generated May 3, 2013 3:35:49 PM by Hibernate Tools 3.6.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Company generated by hbm2java
 */
@Entity
@Table(name = "company", uniqueConstraints = @UniqueConstraint(columnNames = "COMPANY_NAME"))
public class Company implements java.io.Serializable {

	private Long companyId;
	private String companyName;
	private Set<CompanyPhoto> companyPhotos = new HashSet<CompanyPhoto>(0);
	private Set<Client> clients = new HashSet<Client>(0);
	private Set<CompanyCommunication> companyCommunications = new HashSet<CompanyCommunication>(
			0);

	public Company() {
	}

	public Company(String companyName) {
		this.companyName = companyName;
	}

	public Company(String companyName, Set<CompanyPhoto> companyPhotos,
			Set<Client> clients, Set<CompanyCommunication> companyCommunications) {
		this.companyName = companyName;
		this.companyPhotos = companyPhotos;
		this.clients = clients;
		this.companyCommunications = companyCommunications;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "COMPANY_ID", unique = true, nullable = false)
	public Long getCompanyId() {
		return this.companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	@Column(name = "COMPANY_NAME", unique = true, nullable = false)
	public String getCompanyName() {
		return this.companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "company")
	public Set<CompanyPhoto> getCompanyPhotos() {
		return this.companyPhotos;
	}

	public void setCompanyPhotos(Set<CompanyPhoto> companyPhotos) {
		this.companyPhotos = companyPhotos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "company")
	public Set<Client> getClients() {
		return this.clients;
	}

	public void setClients(Set<Client> clients) {
		this.clients = clients;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "company")
	public Set<CompanyCommunication> getCompanyCommunications() {
		return this.companyCommunications;
	}

	public void setCompanyCommunications(
			Set<CompanyCommunication> companyCommunications) {
		this.companyCommunications = companyCommunications;
	}

}
